<include file="Public/min-header"/>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                   <!-- <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Admin/Messages/message_list')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="content" class="form-control" value="{$content}" placeholder="输入问题进行搜索">
                                    </div>

                                    <button type="submit" class="btn btn-default">搜索</button>
                                    &lt;!&ndash;<div class="form-group pull-right">&ndash;&gt;
                                    &lt;!&ndash;<a href="{:U('Admin/Article/article')}" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加文章</a>&ndash;&gt;
                                    &lt;!&ndash;</div>&ndash;&gt;
                                </form>
                            </div>
                        </nav>
                    </div>-->
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
                                    <thead>
                                    <tr role="row">
                                        <th class="sorting_asc"   aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 80px;">序号</th>
                                        <th class="sorting_asc"   aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 500px;">内容</th>
                                        <th class="sorting" tabindex="0" aria-controls="example1"  aria-label="Browser: activate to sort column ascending">用户名</th>
                                        <th class="sorting" tabindex="0" aria-controls="example1"  aria-label="Platform(s): activate to sort column ascending">搜索时间</th>
                                        <!--<th class="sorting" tabindex="0" aria-controls="example1"  aria-label="Platform(s): activate to sort column ascending">状态</th>-->
                                        <!--<th class="sorting" tabindex="0" aria-controls="example1"  aria-label="Platform(s): activate to sort column ascending">显示</th>-->
                                        <!--<th class="sorting" tabindex="0" aria-controls="example1"  aria-label="CSS grade: activate to sort column ascending">操作</th>-->
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="lists" item="vo" key="k" >
                                        <tr role="row" align=" ">
                                            <td>{$vo.id}</td>
                                            <td>{$vo.content}</td>
                                            <td>
                                                <if condition="$vo[user_id] gt 0">
                                                    {$vo.user_id|get_user_name}
                                                    <else/>
                                                    游客
                                                </if>

                                            </td>
                                            <td>{$vo.add_time|date='Y-m-d H:i:s',###}</td>
                                            <!--<td><if condition="$vo[is_check] eq 1" >已回复<else/>待回复</if></td>-->
                                            <!--<td class="text-center">-->
                                                <!--<img width="20" height="20" src="__PUBLIC__/images/<if condition='$vo[is_show] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('messages','id','{$vo.id}','is_show',this)"/>-->
                                            <!--</td>-->
                                            <!--<td>-->
                                                <!--<a class="btn btn-primary" href="{:U('Messages/detail',array('id'=>$vo['id']))}">查看</a>-->
                                                <!--<a class="btn btn-danger" href="javascript:void(0)" data-url="{:U('Messages/delete_message')}" data-id="{$vo.id}" onclick="delfun(this)">删除</a>-->
                                            <!--</td>-->
                                        </tr>
                                    </foreach>
                                    </tbody>
                                    <tfoot>

                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div>
        </div>
    </section>
</div>
<script>
    function delfun(obj){
        if(confirm('确认删除')){
            $.ajax({
                type : 'post',
                url : $(obj).attr('data-url'),
                data : {id:$(obj).attr('data-id')},
                dataType : 'json',
                success : function(data){
                    if(data){
                        $(obj).parent().parent().remove();
                    }else{
                        layer.alert('删除失败', {icon: 2});  //alert('删除失败');
                    }
                }
            })
        }
        return false;
    }

    /*
     * 清除文章静态页面缓存
     */
    function ClearAritcleHtml(article_id)
    {
        $.ajax({
            type:'GET',
            url:"{:U('Admin/System/ClearAritcleHtml')}",
            data:{article_id:article_id},
            dataType:'json',
            success:function(data){
                layer.alert(data.msg, {icon: 2});
            }
        });
    }

</script>
</body>
</html>